home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13091 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Writing to a Memory Address
  5. Date: 4 Apr 1996 07:53 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <4APR199607530406@erich.triumf.ca>
  9. References: <4k001p$dqb@netnews.upenn.edu>
  10. NNTP-Posting-Host: ftp.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <4k001p$dqb@netnews.upenn.edu>, mchyzer@red.seas.upenn.edu (Michael C Hyzer) writes...
  14. >Hello,
  15. >I am running the same gcc for DOS on my pentium desktop and 386 laptop.  
  16. >I am trying to write to the address of the parallel port (0x0378 on both 
  17. >machines).  When i do it on the desktop, with a command such as:
  18. >int *para = (char *)0x0378;
  19.  
  20. The I/O ports are _not_ in the normal memory address space.  Intel processors
  21. have a separate I/O address space that can be accessed only by the assmebly
  22. language IN and OUT instructions, and not by normal memory access instructions.
  23.  
  24. Borland provides inportb() and outportb() functions to access the I/O ports
  25. (Microsoft calls theirs inp() and outp())
  26.  
  27. You will have to see if gcc provides some equivalent function, or do a little
  28. assembly programming...
  29.  
  30.  
  31. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  32. Internet: bennett@triumf.ca         | of one another only when one can be
  33. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  34. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  35. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  36. or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.